﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
using System.IO;

namespace study_csharp
{
    class Program
    {
        //static long FileOrDirCount(string path)
        //{
        //    long count = 0;
        //    try
        //    {
        //        var files = Directory.GetFiles(path);
        //        count += files.Length;
        //        var dirs = Directory.GetDirectories(path);
        //        count += dirs.Length;
        //        foreach (var i in dirs)
        //        {
        //            count += FileOrDirCount(i);
        //        }
        //    }
        //    catch (UnauthorizedAccessException ex)
        //    {
        //        Console.WriteLine(ex.Message);
        //        //  throw;
        //    }

        //    return count;
        //}
        static void Main(string[] args)
        {
            //    Console.WriteLine(FileOrDirCount("F:/"));
            //}




            //static double aver(List<int> list,out int i)
            //{
            //    double sum = 0;
            //    foreach (int x in list)
            //    {
            //        sum += x;

            //    }
            //    i=1;
            //    return (double)sum / list.Count;

            //}
            //static void Main(string[] args)
            //{
            //    var list = new List<int>();
            //    for (int i = 0; i <=10; i++)
            //        list.Add(i);
            //    Console.WriteLine(aver(list));

            //        Console.Read();





            //var list=new List<int>();
            //list.Add(1);
            //list.Add(5);
            //list.Add(2);
            //list.Sort();
            //foreach (int x in list)
            //{
            //    Console.WriteLine("额么么么{0}",x);
            //}

            //#region 计算一下
            //int[] a = new int[50];
            //var r = new Random();
            //for (int i = 0; i < 50;i++ )
            //{
            //    a[i]= r.Next(1,28);
            //}
            //#endregion
            //Console.WriteLine(a.Min());
            //foreach(int x in a)
            //{
            //    Console.WriteLine(x);

            //int[] a = new int[10];
            //a[0] = 1;
            //a[1] = 1;
            //for (int i = 2; i < 10; i++)
            //{
            //    a[i] = a[i - 1] + a[i - 2];
            //}
            //foreach (int x in a)
            //{
            //    Console.WriteLine(x);
            //}
            //int a = 50;
            //  string str1 = "abc";
            //  string str2 = str1.ToUpper();
            // Console.WriteLine(a.ToString());

            //int[] a=new int[12];
            //a[0] = 1;
            //a[1] = 1;
            //for (int i = 2; i < 10; i++)
            //{
            //    a[i] = a[i - 1] + a[i - 2];
            //}
            //for (int i = 0; i < 10;i++ )
            //    Console.WriteLine(a[i]);

            //var str1 = Console.ReadLine();
            ////       var str2 = Console.ReadLine();
            //int a1;
            //if (int.TryParse(str1, out a1))
            //{
            //    Console.WriteLine(a1);
            //}
            //else
            //{
            //    Console.WriteLine("解析失败");
            //}
            //int a2 = int.Parse(str2);
            //Console.WriteLine(a1 + a2);

            //int a;
            //checked
            //{
            //    a = int.MaxValue;
            //    a += 1;
            //}

            //Console.WriteLine(a);

            Stopwatch 计时器 = new Stopwatch();
            计时器.Start();
            int? num = null;

            StringBuilder sb = new StringBuilder();
            for (int i = 1; i < 10000; i++)
            {
                sb.Append(i.ToString());
            }
            string a = "abc";
            //string b = @"adsjdgha\asdjh";
            a = a.ToUpper();
            Console.WriteLine(a);
            //Console.WriteLine(b);
            string str = string.Empty;
            for (int i = 1; i < 10000; i++)
            {
                str += i.ToString();
            }
            Console.WriteLine(str);
            计时器.Stop();
            Console.WriteLine(计时器.ElapsedMilliseconds);


        }
    }
}
